<template>
  <!-- 分类列表 右模块 -->
  <div>
    <div v-if="!type">
      <div class="_classlist border-bottom" v-for="(item,index) in list" :key="index">
        <div class="_classlist_title">{{item.type_name}}</div>
        <div class="_classlist_ul flex flex-wrap text-center text-content">
          <div
            class="_classlist_li"
            v-for="(items, indexs) in item.threeCate"
            :key="indexs"
            @click="to('/recruit/list', indexs , index)"
          >
            <img v-lazy="items.thumb" alt />
            <div class="text-cut-one text-66 rem-26px">{{items.type_name}}</div>
          </div>
        </div>
      </div>
    </div>

    <div v-if="type" class="_classlist_title_nb">
      <div class="_classlist_title">频道精选</div>
      <div class="_classlist_ul flex flex-wrap text-center text-content">
        <div
          class="_classlist_li"
          v-for="(item, index) in list"
          :key="index"
          @click="http(item.ad_url)"
        >
          <img v-lazy="item.thumb" alt />
          <div class="text-cut-one text-66 rem-26px">{{item.ad_title}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array
    },
    type: {
      type: Number
    },
    one_id: {
      type: Number
    }
  },
  data() {
    return {
      dataList: this.list
    };
  },
  watch: {
    list(n) {
      this.dataList = this.list;
    }
  },
  methods: {
    // 携带参数跳转
    to(path, id, two) {
      if (id == 0 || id) {
        this.$router.push(path + "#one_id=" + this.one_id + '&two_id=' + (two + 1) + '&three_id=' + (id + 1));
        window.localStorage.setItem('backurl', 'class')
        return false;
      }
      this.$router.push({
        path: path
      })
    },
    http(path){
      window.location.href = path
    }
  }
};
</script>

<style scoped>
._classlist {
  padding: 0 0.25rem;
}
._classlist_title {
  padding-top: 0.3rem;
  padding-bottom: 0.74rem;
  font-size: 0.3rem;
  color: #333;
}
._classlist_li {
  width: 33.3%;
  padding-bottom: 0.32rem;
}
._classlist ._classlist_li:nth-of-type(3n) {
  padding-right: none;
}
._classlist_li img {
  /* width: 1.3rem;
  height: 1.3rem; */
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 5px;
  display: inline-block;
  margin-bottom: 0.19rem;
  object-fit: contain;
}
._classlist_title_nb img{
  width: 1.1rem;
  height: 1.1rem
}
</style>
